package com.sefon.smarteconomy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.sefon.smarteconomy.dao.I${objectName}Dao;
import com.sefon.smarteconomy.domain.${objectName};
import com.sefon.smarteconomy.service.I${objectName}Service;

/**
 * 
* Copyright: Copyright (c) 2018 SefonSoft
* 
* @ClassName: ${objectName}ServiceImpl.java
* @Description: ${objectDesc}service接口实现类
*
* @version: v1.0.0
* @author: SF2170
* @date: ${timeStr}
* @by AnalysisExcel2File.java
*
 */
@Service
public class ${objectName}ServiceImpl implements I${objectName}Service {

	@Autowired
	private I${objectName}Dao ${simName}Dao;
	
	/**
	 * 
	*
	* @return
	* @see com.sefon.smarteconomy.service.I${objectName}Service#queryList()
	*
	* Modification History:
	* Date         Author          Version            Description
	*---------------------------------------------------------*
	* ${dateStr}     SF2170           v1.0.0             修改原因
	 */
 	@Cacheable
	@Override
	public List<${objectName}> queryList() {
		return ${simName}Dao.findAll();
	}

	/**
	 * 
	*
	* @param ${simName}
	* @see com.sefon.smarteconomy.service.I${objectName}Service#save(com.sefon.smarteconomy.domain.${objectName})
	*
	* Modification History:
	* Date         Author          Version            Description
	*---------------------------------------------------------*
	* ${dateStr}      SF2170           v1.0.0               修改原因
	 */
	@Override
	public void save(${objectName} ${simName}) {
		${simName}Dao.save(${simName});
	}

	/**
	 * 
	*
	* @param ${idClassName}
	* @see com.sefon.smarteconomy.service.I${objectName}Service#deleteBy${IdName}(java.lang.${idType})
	*
	* Modification History:
	* Date         Author          Version            Description
	*---------------------------------------------------------*
	* ${dateStr}     SF2170           v1.0.0               修改原因
	 */
	@Override
	public void deleteBy${IdName}(${idType} ${idClassName}) {
		${simName}Dao.deleteById(${idClassName});
		
	}

	/**
	 * 
	*
	* @param ${idClassName}
	* @return
	* @see com.sefon.smarteconomy.service.I${objectName}Service#findBy${IdName}(java.lang.${idType})
	*
	* Modification History:
	* Date         Author          Version            Description
	*---------------------------------------------------------*
	* ${dateStr}      SF2170           v1.0.0               修改原因
	 */
	@Override
	public ${objectName} findBy${IdName}(${idType} ${idClassName}) {
		return ${simName}Dao.findOneById(${idClassName});
	}

}
